home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6757 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.4 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Secure from Decompiling??
  5. Date: 14 Feb 1996 13:38:59 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4ftkpjINNg7f@keats.ugrad.cs.ubc.ca>
  8. References: <4djaq2$jd5@earth.superlink.net> <31167bd7.15907136@netline-fddi.jpl.nasa.gov> <4fi9d4$g4l@redstone.interpath.net> <31211aae.2439037@netline-fddi.jpl.nasa.gov>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <31211aae.2439037@netline-fddi.jpl.nasa.gov>,
  12. Kevin Quitt <kdq@emoryi.jpl.nasa.gov> wrote:
  13.  >
  14.  >>If a good
  15.  >>decompiler can take an offset into memory and determine that a statically
  16.  >>linked routine is a library function, it's pretty darn good.
  17.  >
  18.  >Why would it bother doing it the way you describe?  Decompilers don't work on
  19.  >the executable image, they work on the executable FILE.  Certain things in
  20.  >executables are clearly marked:  for example, the entry point.  By examining
  21.  >the entry code and/or looking for copyright notices, it's possible to
  22.  >determine the manufacturer of the compiler and usually determine the version
  23.  >number.  Simple binary comparisons based on knowing what the libraries are for
  24.  >that version of that compiler trivially not only identify the library as such,
  25.  >but also identify the names and types of parameters being passed to them, and
  26.  >meaningful variable names can be generated.  So by your definition, if not by
  27.  >your method, this alone will make a decompiler "pretty good".
  28.  
  29. What about string literals interspersed among code? I could randomly put
  30. fragments of what _seems_ like valid machine code into the literals.
  31. There are some _disassemblers_ that can't deal with embedded strings.
  32. I could, for instance, put inside a string literal what appears to be the start
  33. of a procedure, but is not well-formed. Without a symbol table, your decompiler
  34. would have to start at the entry point of the program, look for branches and
  35. divide the program into basic blocks by recursively following the control-flow
  36. hierarchy. This might succeed in isolating objects in the code section that are
  37. not code---or possibly code that is never called.
  38.  
  39. Still, in C compiled programs, there is the possiblity that some functions are
  40. only called via dereference from function pointers (for example,
  41. statically-linked device drivers accessed from a structure table will typically
  42. never contain a direct branch to any of their code).
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  >
  50.  >>Okay, so where's the C++ decompiler that recognizes class libraries,
  51.  >>then!?!
  52.  >
  53.  >Are there libraries that service these classes that are not used by anything
  54.  >else?  If so, they can be identified.  Besides, you seem to have the idea that
  55.  >a decompiler will produce a program identical to the original; it doesn't.  It
  56.  >merely produces a program that does the same things.
  57.  >
  58.  >
  59.  >>How would a decompiler even KNOW that a class library
  60.  >>was being used?!
  61.  >
  62.  >If you're interested, you can get their paper, or read my comments on the
  63.  >page http://wwwis.cs.utwente.nl:8080/~faase/Ha/decompile.html.  And if you
  64.  >really are interested, instead of trying to prove it's impossible, start
  65.  >thinking about what you could do to achieve.  If you try to prove it's
  66.  >impossible, it will be - for you.
  67.  >-- 
  68.  >#include <standard.disclaimer>                   http://emoryi.jpl.nasa.gov/
  69.  > _
  70.  >Kevin D Quitt  USA 91351-4454           96.37% of all statistics are made up
  71.  
  72.  
  73. -- 
  74.  
  75.